-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Collect all child nodes of lists and tables in StructTree #20327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Collect all child nodes of lists and tables in StructTree #20327
Conversation
|
|
||
| const element = new StructElementNode(this, dict); | ||
| map.set(dict, element); | ||
| switch (element.role) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a test to make sure that this behavior can't regress in the future.
|
I need to think about that: I'm not sure it's the right approach. |
|
Added a unit test case |
test/test_manifest.json
Outdated
| "lastPage": 1, | ||
| "type": "eq" | ||
| }, | ||
| { "id": "issue20324", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes in this file are useless.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was created running the add_test script so I thought it was needed somewhere. I'll revert it!
test/unit/api_spec.js
Outdated
| await loadingTask.destroy(); | ||
| }); | ||
|
|
||
| it("should collect all list and table items in StructTree", async function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any specific reason to have this test in this file instead of struct_tree_spec ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, I'll move it
Attempt to fix #20324
Tree nodes are collected bottom-up, so I think it is safe when a list or table item is collected, to collect its children too